/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.hazard.source.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 危险源监控因子设置
 *
 * @author daijie
 * @date 2023-11-01 17:32:11
 */
@Data
@TableName(value = "haz_monitor_factor")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "危险源监控因子设置")
public class HazMonitorFactorEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 危险源
     */
    @Schema(description = "危险源")
    private Long hazardSourceId;

    /**
     * 所属储存设备
     */
    @Schema(description = "所属储存设备")
    private Long storageId;

    /**
     * 监控点
     */
    @Schema(description = "监控点")
    private Long monitorSiteId;

    /**
     * 监控因子
     */
    @Schema(description = "监控因子")
    private Long factorId;

    /**
     * 监控因子名
     */
    @Schema(description = "监控因子名")
    private String factorName;

    /**
     * 点位码
     */
    @Schema(description = "点位码")
    private String dataCode;

    /**
     * 是否核心参数
     */
    @Schema(description = "是否核心参数")
    private Boolean coreFlag;

    /**
     * 状态
     */
    @Schema(description = "状态")
    private Boolean useStatus;

    /**
     * 是否有高报
     */
    @Schema(description = "是否有高报")
    private Boolean haveHighAlarmFlag;

    /**
     * 是否有低报
     */
    @Schema(description = "是否有低报")
    private Boolean haveLowAlarmFlag;

    /**
     * 是否有量程
     */
    @Schema(description = "是否有量程")
    private Boolean haveRangeFlag;

    /**
     * 量程最大值
     */
    @Schema(description = "量程最大值")
    private BigDecimal maxRange;

    /**
     * 量程最小值
     */
    @Schema(description = "量程最小值")
    private BigDecimal minRange;

    /**
     * 计量单位
     */
    @Schema(description = "计量单位")
    private String unitName;

    /**
     * 高报
     */
    @Schema(description = "高报")
    private BigDecimal valueH;

    /**
     * 高高报
     */
    @Schema(description = "高高报")
    private BigDecimal valueHh;

    /**
     * 低报
     */
    @Schema(description = "低报")
    private BigDecimal valueL;

    /**
     * 低低报
     */
    @Schema(description = "低低报")
    private BigDecimal valueLl;

    /**
     * 排序号
     */
    @Schema(description = "排序号")
    private Integer sortNum;

    /**
     * 是否断网 1.是 0.否
     */
    @Schema(description = "是否断网 1.是 0.否")
    private Boolean alarmBrokenNet;

    /**
     * 是否超标
     */
    @Schema(description = "是否超标")
    private Boolean alarmOverStandard;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

    public String getHazardSourceIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.hazard_source, this.hazardSourceId);
    }

    public String getStorageIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.storage_info,this.storageId);
    }

    public String getCoreFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.coreFlag);
    }

    public String getUseStatusStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useStatus);
    }

    public String getHaveRangeFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.haveRangeFlag);
    }

    public String getHaveHighAlarmFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.haveHighAlarmFlag);
    }

    public String getHaveLowAlarmFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.haveLowAlarmFlag);
    }
}
